﻿using System.Collections.Generic;
using RilattackLibrary;
using System;

namespace RilattackGameWPF
{
    public class CallBack : ICallBack
    {
        // initialisé par .
        public Scene Scene
        {
            get; set;
        }

        // initialisé pendant le login
        public ControlablePlayer CurrentPlayer
        {
            get; set;
        }

        public void UpdateScene()
        {
            throw new System.NotImplementedException();
        }

        public void beginNewGame(GameConfiguration configuration)
        {
            App.Window.Close();
            App.LaunchGame();
            Scene.Instance.GameConfiguration = configuration;
        }

        public void initialisePlayer(Guid playerUid, string pseudo, int posX, int posY)
        {
            Player p;
            if(playerUid == CurrentPlayer.UID){
                p = CurrentPlayer;
            }else{
                p = new Player();
                p.Nickname = pseudo;
            }
            p.SetRect(posX, posY, 60, 60);
            Scene.Instance.AddPlayer(p);
        }


        public void playerMove(Guid playerUid, int posX, int posY)
        {
            
        }
    }
}